package org.ediba.siri.core.user.service;

import java.util.List;

import org.ediba.siri.core.user.domain.User;
import org.ediba.siri.core.user.domain.UserGroup;
import org.ediba.siri.core.user.domain.UserRole;

public interface UserService {
	
	/**************************USER***************************/
	abstract User create(String name, String password);
	abstract User retrieve(int id);
	abstract User retrieve(String name);
	abstract User retrieveCurrent();
	abstract User update(User user);
	abstract boolean delete(int id);
	
	abstract List<User> retrieve();
	abstract List<User> retrieve(String sort,boolean dir,int start, int limit);
	
	abstract boolean currentHasRole(String roleName);
	
	/**************************USERROLE***************************/
	abstract UserRole roleRetrieve(int id);
	abstract List<UserRole> roleRetrieve();
	abstract List<UserRole> roleRetrieveByUser(int idUser);
	abstract List<UserRole> roleRetrieveForUser(int idUser);
	abstract List<UserRole> roleRetrieveByUserGroup(int idUserGroup);
	
	/**************************USERGROUP***************************/
	abstract UserGroup groupCreate(String name);
	abstract List<UserGroup> groupRetrieve();
	abstract UserGroup groupRetrieve(int id);
	abstract List<UserGroup> groupRetrieveByUser(int idUser);
	abstract UserGroup groupUpdate(UserGroup userGroup);
	abstract boolean groupDelete(int id);
}
